﻿using FullAppPrismNetDesktop.Modules.ModuleName;
using FullAppPrismNetDesktop.Services;
using FullAppPrismNetDesktop.Services.Interfaces;
using FullAppPrismNetDesktop.Views;
using NLog;
using Prism.DryIoc;
using Prism.Ioc;
using Prism.Modularity;
using System.Windows;

namespace FullAppPrismNetDesktop
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App: PrismApplication
    {
        public static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
        public App()
        {
            NLog.LogManager.Setup().LoadConfiguration(builder => {
                builder.ForLogger().FilterMinLevel(NLog.LogLevel.Info).WriteToConsole();
                builder.ForLogger().FilterMinLevel(NLog.LogLevel.Debug).WriteToFile(fileName: "file.txt");
            });
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("NzAyOTc5QDMxMzkyZTM0MmUzMGR2ZWQ0N1g1REpVaG94NXdjWkdvZGtaSkJmU05tbmVSaVBuQU9qTFUvVFU9");

        }
        protected override Window CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton<IMessageService, MessageService>();
        }

        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<ModuleNameModule>();
            moduleCatalog.AddModule<DevicesModule>();
        }
    }
}
